package com.e3.basdoc.cust.client;

import java.util.List;

import com.e3.basdoc.cust.model.CustModel;
import com.e3.template.tgf.MyTGFUI;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFFormPanel;
import com.e3.template.tgf.TGFGridPanel;
import com.e3.template.tgf.TGFQueryDialog;
import com.e3.template.tgf.TGFTreePanelAsync;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Description: <br>
 * 
 * @author: <a href="mailto:senton1101@126.com">TianXiangdong</a> 2010-7-27 上午10:41:03
 * @version: 1.0
 */
public class CustUI extends MyTGFUI<CustModel> {

	// 跟后台交互的Service
	private CustRPCServiceAsync service = CustRPCService.Util.getInstance();

	@Override
	protected TGFTreePanelAsync<CustModel> createTreePanel() {
		return new CustTreePanel();
	}

	@Override
	protected TGFFormPanel<CustModel> createFormPanel() {
		return new CustFormPanel();
	}

	@Override
	protected TGFGridPanel<CustModel> createGridPanel() {
		return new CustGridPanel();
	}

	@Override
	protected TGFQueryDialog<CustModel> createQueryDialog() {
		return new CustQueryDialog();
	}

	@Override
	protected TGFEditorDialog<CustModel> createEditorDialog() {
		return new CustEditorDialog();
	}

	@Override
	protected void executeDeleteService(List<CustModel> models,	AsyncCallback<Void> callback) {
		service.deleteCusts(models, callback);
	}

	@Override
	protected String getCurrentLocalName() {
		return CustMessages.INSTANCE.local_name();
	}

	@Override
	protected CustModel createModelInstance() {
		return CustHelper.INSTANCE.createModelInstance();
	}

}
